class Run:
    @classmethod
    def People_run(cls):
        print("people can run")


class People:
    def __init__(self,name):
        self.name=name
        self.run=Run
    def eat(self):
        print("{} eat somthing".format(self.name))
p=People("张三")
p.eat()


#这个hasattr方法不光可以判断某个对象里是否有某个属性，还可以判断某个方法是否属于某个对象
print(hasattr(p,'eat'))
print(hasattr(p,"name"))

p.run.People_run()